<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>生姜&鱼饼</title>商城</title>
    <link rel="stylesheet" href="./css/首页.css">
</head>

<body>
    <div class="head">
        <a href="./index.html" class="left"><img src="/img/生姜&鱼饼.png" alt=""></a>
        
        <a href="#" class="right"><img src="./img/xiazai1.jpg" alt=""></a>
    </div>

    <section id="search">
        <div>
            <input type="text" placeholder="请输入想查找的商品">
            <button>搜索</button>
        </div>
    </section>

    <nav id="nav">
        <div>
            <ul>
                <li class="intent"><a href="./pages/比价搜索.html"><span><img src="./img/ic_search.png"alt="比价搜索"></span></a><b>比价搜索</b></li>
                <li class="intent"><a href="./pages/省钱控.html"><span><img src="./img/ic_cu.png" alt=""></span></a><b>省钱控</b></li>
                <li class="intent"><a href="./pages/国内折扣.html"><span><img src="./img/ic_coudanpin.png"alt=""></span></a><b>国内折扣</b></li>
                <li class="intent"><a href="./pages/白菜价.html"><span><img src="./img/ic_bcj.png" alt=""></span></a><b>白菜价</b></li>
                <li class="intent"><a href="./pages/省钱控.html"><span><img src="./img/haitao.png" alt=""> </span></a><b>海淘折扣</b></li>
                <li class="intent"><a href="./pages/优惠券.html"><span><img src="./img/ic_temai.png" alt=""></span></a><b>优惠卷</b></li>
                <li class="intent"><a href="./pages/比价搜索.html"><span><img src="./img/ic_trend.png" alt=""></span></a><b>查历史价</b></li>
                <li class="intent"><a href=""><span><img src="./img/gengduo.png" alt=""></span></a><b>更多</b></li>
                <li class="intent"><a href="./pages/凑单品.html"><span><img src="./img/ic_coudanpin.png" alt=""></span></a><b>凑单品</b></li>
                <li class="intent"><a href="./pages/比价搜索.html"><span><img src="./img/ic_kb.png" alt=""></span></a><b>口碑排行</b></li>
                <li class="intent"><a href="./pages/商品导航.html"><span><img src="./img/ic_mall.png" alt=""></span></a><b>商城导航</b></li>
                <li class="intent"><a href="./pages/品牌大全.html"><span><img src="./img/ic_pp.png" alt=""></span></a><b>品牌大全</b></li>
            </ul>
        </div>
    </nav>


    <div class="discount">
        <div class="top">
        <h1>折扣推荐</h1>
       <a href=""><img src="./img/rightjt(1).jpg" alt=""></a>
        </div>
        
        <div class="lazying">
            <ul class="thing">
                
            </ul>
        </div>
    </div>

    <section id="footer">
        <div class="more">
            <a href="">更多优惠信息>></a>
        </div>
        <div id="chart">
            <span>品牌排行</span>
            <a href=""><img src="./img/left.jpg" alt=""></a>
        </div>
        <div id="login">
            <div id="row">
                <a href=""><div>登入</div></a>
                <a href=""><div>注册</div></a>
                <div class="gotop">返回顶部</div>
            </div>
            <div id="conter">
                <p>
                    <a href="">手机APP下载</a>
                    <a href="">万锋智慧商城手机版</a>
                    <span>--掌上比价平台</span>
                </p>
                <p>chst.vip:8081/cm</p>
            </div>
        </div>

    </section>
</body>

</html>
<script src="./jquery.min.js"></script>
<script src="./适配/flexible.js"></script>
<script>
    $('.click').prop('isExpand', false).click(function () {
    let isExpand = $(this).prop('isExpand')
    if (!isExpand) {
        $(this).prop('isExpand', true).nextAll().slideDown(200)

    } else {
        $(this).prop('isExpand', false).nextAll().slideUp(200)
    }
})
    let regExp = /^<[^<]+\s+src="([^''""]*)"/
    fetch('http://chst.vip:1234/api/getmoneyctrl')
        .then(body => body.json())
        .then(res => {
            console.log(res);
            let data = res.result
            let html = ''
            let thing = document.querySelector('.thing')
            data.forEach(item => {
                html += `
                <li>
                    
                <a href="">
                ${item.productImgSm}
                <div id="top">
                    <h4>
                        <b>${item.productName}</b>
                        <span>${item.productPinkage}</span>
                    </h4>
                </div>
                <div id="bottn">
                    <span>${item.productFrom} |</span>
                    <span>${item.productTime}</span>
                    <span id="ic">
                        <img src="./img/yuyan.jpg" style="width:15px;height:15px"></img>
                        <i>${item.productComCount}</i>
                    </span>
                    
                    
                </div>
                  </a>
               
             
         </li>
                `
            })
            thing.innerHTML = html
        })



        function scrollHandler() {
        const height = $(this).scrollTop()
        if(height>=10) {
            $('.gotop').fadeIn(500)
        }else{
            $('.gotop').fadeOut(500)
        }
    }

    scrollHandler()
    $(window).scroll(scrollHandler)

    $('.gotop').click(function () {
      $('body, html').animate({ scrollTop: 0 }, 1000)
    })


</script>